import Vue from "vue";
import VueRouter from "vue-router";
import { routesInfo } from "@/data/btn.js";

Vue.use(VueRouter);

const routes = routesInfo.map((item) => {
  const { path, name, component } = item;

  return {
    path,
    name,
    component,
  };
});

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
